<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>keyczar.keyinfo</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="keyczar-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >Keyczar</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="keyczar-module.html">Package&nbsp;keyczar</a> ::
        Module&nbsp;keyinfo
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="keyczar.keyinfo-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="keyczar.keyinfo-module.html">Module keyczar.keyinfo</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/python2.4</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Copyright 2008 Google Inc.</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Licensed under the Apache License, Version 2.0 (the "License");</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># you may not use this file except in compliance with the License.</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You may obtain a copy of the License at</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># </tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#      http://www.apache.org/licenses/LICENSE-2.0</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># </tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Unless required by applicable law or agreed to in writing, software</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># distributed under the License is distributed on an "AS IS" BASIS,</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># See the License for the specific language governing permissions and</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># limitations under the License.</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">Defines several 'enums' encoding information about keys, such as type,</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">status, purpose, and the cipher mode.</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">@author: arkajit.dey@gmail.com (Arkajit Dey)</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"> </tt>
<a name="_NameId"></a><div id="_NameId-def"><a name="L24"></a><tt class="py-lineno"> 24</tt> <a class="py-toggle" href="#" id="_NameId-toggle" onclick="return toggle('_NameId');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyinfo._NameId-class.html">_NameId</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_NameId-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_NameId-expanded"><a name="_NameId.__init__"></a><div id="_NameId.__init__-def"><a name="L25"></a><tt class="py-lineno"> 25</tt> <a class="py-toggle" href="#" id="_NameId.__init__-toggle" onclick="return toggle('_NameId.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo._NameId-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">id</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_NameId.__init__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="_NameId.__init__-expanded"><a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> <tt class="py-op">=</tt> <tt class="py-name">name</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">=</tt> <tt class="py-name">id</tt> </tt>
</div><a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">   </tt>
<a name="_NameId.__str__"></a><div id="_NameId.__str__-def"><a name="L29"></a><tt class="py-lineno"> 29</tt> <a class="py-toggle" href="#" id="_NameId.__str__-toggle" onclick="return toggle('_NameId.__str__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo._NameId-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_NameId.__str__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="_NameId.__str__-expanded"><a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> </tt>
</div></div><a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">   </tt>
<a name="KeyType"></a><div id="KeyType-def"><a name="L32"></a><tt class="py-lineno"> 32</tt> <a class="py-toggle" href="#" id="KeyType-toggle" onclick="return toggle('KeyType');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyinfo.KeyType-class.html">KeyType</a><tt class="py-op">(</tt><tt class="py-base-class">_NameId</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="KeyType-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="KeyType-expanded"><a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">  Encodes different key types and their properties:</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring">    - AES</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">    - HMAC-SHA1</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">    - DSA Private</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">    - DSA Public</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">    - RSA Private</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    - RSA Public</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">   </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">  <tt id="link-0" class="py-name" targets="Variable keyczar.keyinfo.KeyType.sizes=keyczar.keyinfo.KeyType-class.html#sizes"><a title="keyczar.keyinfo.KeyType.sizes" class="py-name" href="#" onclick="return doclink('link-0', 'sizes', 'link-0');">sizes</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">self</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__sizes</tt><tt class="py-op">,</tt>  </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">                   <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"""List of valid key sizes for this key type."""</tt><tt class="py-op">)</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">  <tt class="py-comment"># clients can't modify sizes</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-comment"></tt>   </tt>
<a name="KeyType.__init__"></a><div id="KeyType.__init__-def"><a name="L47"></a><tt class="py-lineno"> 47</tt> <a class="py-toggle" href="#" id="KeyType.__init__-toggle" onclick="return toggle('KeyType.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo.KeyType-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">id</tt><tt class="py-op">,</tt> <tt class="py-param">sizes</tt><tt class="py-op">,</tt> <tt class="py-param">output_size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="KeyType.__init__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="KeyType.__init__-expanded"><a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">    <tt id="link-1" class="py-name" targets="Class keyczar.keyinfo._NameId=keyczar.keyinfo._NameId-class.html"><a title="keyczar.keyinfo._NameId" class="py-name" href="#" onclick="return doclink('link-1', '_NameId', 'link-1');">_NameId</a></tt><tt class="py-op">.</tt><tt id="link-2" class="py-name" targets="Method keyczar.errors.BadVersionError.__init__()=keyczar.errors.BadVersionError-class.html#__init__,Method keyczar.errors.InvalidSignatureError.__init__()=keyczar.errors.InvalidSignatureError-class.html#__init__,Method keyczar.errors.KeyNotFoundError.__init__()=keyczar.errors.KeyNotFoundError-class.html#__init__,Method keyczar.errors.NoPrimaryKeyError.__init__()=keyczar.errors.NoPrimaryKeyError-class.html#__init__,Method keyczar.errors.ShortCiphertextError.__init__()=keyczar.errors.ShortCiphertextError-class.html#__init__,Method keyczar.errors.ShortSignatureError.__init__()=keyczar.errors.ShortSignatureError-class.html#__init__,Method keyczar.keyczar.Keyczar.__init__()=keyczar.keyczar.Keyczar-class.html#__init__,Method keyczar.keyczart._Name.__init__()=keyczar.keyczart._Name-class.html#__init__,Method keyczar.keydata.KeyMetadata.__init__()=keyczar.keydata.KeyMetadata-class.html#__init__,Method keyczar.keydata.KeyVersion.__init__()=keyczar.keydata.KeyVersion-class.html#__init__,Method keyczar.keyinfo.CipherMode.__init__()=keyczar.keyinfo.CipherMode-class.html#__init__,Method keyczar.keyinfo.KeyType.__init__()=keyczar.keyinfo.KeyType-class.html#__init__,Method keyczar.keyinfo._NameId.__init__()=keyczar.keyinfo._NameId-class.html#__init__,Method keyczar.keys.AesKey.__init__()=keyczar.keys.AesKey-class.html#__init__,Method keyczar.keys.AsymmetricKey.__init__()=keyczar.keys.AsymmetricKey-class.html#__init__,Method keyczar.keys.DsaPrivateKey.__init__()=keyczar.keys.DsaPrivateKey-class.html#__init__,Method keyczar.keys.DsaPublicKey.__init__()=keyczar.keys.DsaPublicKey-class.html#__init__,Method keyczar.keys.HmacKey.__init__()=keyczar.keys.HmacKey-class.html#__init__,Method keyczar.keys.Key.__init__()=keyczar.keys.Key-class.html#__init__,Method keyczar.keys.PrivateKey.__init__()=keyczar.keys.PrivateKey-class.html#__init__,Method keyczar.keys.PublicKey.__init__()=keyczar.keys.PublicKey-class.html#__init__,Method keyczar.keys.RsaPrivateKey.__init__()=keyczar.keys.RsaPrivateKey-class.html#__init__,Method keyczar.keys.RsaPublicKey.__init__()=keyczar.keys.RsaPublicKey-class.html#__init__,Method keyczar.keys.SymmetricKey.__init__()=keyczar.keys.SymmetricKey-class.html#__init__,Method keyczar.readers.EncryptedReader.__init__()=keyczar.readers.EncryptedReader-class.html#__init__,Method keyczar.readers.FileReader.__init__()=keyczar.readers.FileReader-class.html#__init__"><a title="keyczar.errors.BadVersionError.__init__
keyczar.errors.InvalidSignatureError.__init__
keyczar.errors.KeyNotFoundError.__init__
keyczar.errors.NoPrimaryKeyError.__init__
keyczar.errors.ShortCiphertextError.__init__
keyczar.errors.ShortSignatureError.__init__
keyczar.keyczar.Keyczar.__init__
keyczar.keyczart._Name.__init__
keyczar.keydata.KeyMetadata.__init__
keyczar.keydata.KeyVersion.__init__
keyczar.keyinfo.CipherMode.__init__
keyczar.keyinfo.KeyType.__init__
keyczar.keyinfo._NameId.__init__
keyczar.keys.AesKey.__init__
keyczar.keys.AsymmetricKey.__init__
keyczar.keys.DsaPrivateKey.__init__
keyczar.keys.DsaPublicKey.__init__
keyczar.keys.HmacKey.__init__
keyczar.keys.Key.__init__
keyczar.keys.PrivateKey.__init__
keyczar.keys.PublicKey.__init__
keyczar.keys.RsaPrivateKey.__init__
keyczar.keys.RsaPublicKey.__init__
keyczar.keys.SymmetricKey.__init__
keyczar.readers.EncryptedReader.__init__
keyczar.readers.FileReader.__init__" class="py-name" href="#" onclick="return doclink('link-2', '__init__', 'link-2');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">id</tt><tt class="py-op">)</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__sizes</tt> <tt class="py-op">=</tt> <tt id="link-3" class="py-name"><a title="keyczar.keyinfo.KeyType.sizes" class="py-name" href="#" onclick="return doclink('link-3', 'sizes', 'link-0');">sizes</a></tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">output_size</tt> <tt class="py-op">=</tt> <tt class="py-name">output_size</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">default_size</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__sizes</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
</div><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">   </tt>
<a name="KeyType.IsValidSize"></a><div id="KeyType.IsValidSize-def"><a name="L53"></a><tt class="py-lineno"> 53</tt> <a class="py-toggle" href="#" id="KeyType.IsValidSize-toggle" onclick="return toggle('KeyType.IsValidSize');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo.KeyType-class.html#IsValidSize">IsValidSize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="KeyType.IsValidSize-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="KeyType.IsValidSize-expanded"><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-4" class="py-name" targets="Variable keyczar.keys.Key.size=keyczar.keys.Key-class.html#size"><a title="keyczar.keys.Key.size" class="py-name" href="#" onclick="return doclink('link-4', 'size', 'link-4');">size</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__sizes</tt> </tt>
</div></div><a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"><tt id="link-5" class="py-name" targets="Variable keyczar.keyinfo.AES=keyczar.keyinfo-module.html#AES"><a title="keyczar.keyinfo.AES" class="py-name" href="#" onclick="return doclink('link-5', 'AES', 'link-5');">AES</a></tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name" targets="Class keyczar.keyinfo.KeyType=keyczar.keyinfo.KeyType-class.html"><a title="keyczar.keyinfo.KeyType" class="py-name" href="#" onclick="return doclink('link-6', 'KeyType', 'link-6');">KeyType</a></tt><tt class="py-op">(</tt><tt class="py-string">"AES"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">128</tt><tt class="py-op">,</tt> <tt class="py-number">192</tt><tt class="py-op">,</tt> <tt class="py-number">256</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"><tt id="link-7" class="py-name" targets="Variable keyczar.keyinfo.HMAC_SHA1=keyczar.keyinfo-module.html#HMAC_SHA1"><a title="keyczar.keyinfo.HMAC_SHA1" class="py-name" href="#" onclick="return doclink('link-7', 'HMAC_SHA1', 'link-7');">HMAC_SHA1</a></tt> <tt class="py-op">=</tt> <tt id="link-8" class="py-name"><a title="keyczar.keyinfo.KeyType" class="py-name" href="#" onclick="return doclink('link-8', 'KeyType', 'link-6');">KeyType</a></tt><tt class="py-op">(</tt><tt class="py-string">"HMAC_SHA1"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">256</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">20</tt><tt class="py-op">)</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable keyczar.keyinfo.DSA_PRIV=keyczar.keyinfo-module.html#DSA_PRIV"><a title="keyczar.keyinfo.DSA_PRIV" class="py-name" href="#" onclick="return doclink('link-9', 'DSA_PRIV', 'link-9');">DSA_PRIV</a></tt> <tt class="py-op">=</tt> <tt id="link-10" class="py-name"><a title="keyczar.keyinfo.KeyType" class="py-name" href="#" onclick="return doclink('link-10', 'KeyType', 'link-6');">KeyType</a></tt><tt class="py-op">(</tt><tt class="py-string">"DSA_PRIV"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">1024</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">48</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt id="link-11" class="py-name" targets="Variable keyczar.keyinfo.DSA_PUB=keyczar.keyinfo-module.html#DSA_PUB"><a title="keyczar.keyinfo.DSA_PUB" class="py-name" href="#" onclick="return doclink('link-11', 'DSA_PUB', 'link-11');">DSA_PUB</a></tt> <tt class="py-op">=</tt> <tt id="link-12" class="py-name"><a title="keyczar.keyinfo.KeyType" class="py-name" href="#" onclick="return doclink('link-12', 'KeyType', 'link-6');">KeyType</a></tt><tt class="py-op">(</tt><tt class="py-string">"DSA_PUB"</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">1024</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">48</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt id="link-13" class="py-name" targets="Variable keyczar.keyinfo.RSA_PRIV=keyczar.keyinfo-module.html#RSA_PRIV"><a title="keyczar.keyinfo.RSA_PRIV" class="py-name" href="#" onclick="return doclink('link-13', 'RSA_PRIV', 'link-13');">RSA_PRIV</a></tt> <tt class="py-op">=</tt> <tt id="link-14" class="py-name"><a title="keyczar.keyinfo.KeyType" class="py-name" href="#" onclick="return doclink('link-14', 'KeyType', 'link-6');">KeyType</a></tt><tt class="py-op">(</tt><tt class="py-string">"RSA_PRIV"</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">2048</tt><tt class="py-op">,</tt> <tt class="py-number">1024</tt><tt class="py-op">,</tt> <tt class="py-number">768</tt><tt class="py-op">,</tt> <tt class="py-number">512</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">256</tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt id="link-15" class="py-name" targets="Variable keyczar.keyinfo.RSA_PUB=keyczar.keyinfo-module.html#RSA_PUB"><a title="keyczar.keyinfo.RSA_PUB" class="py-name" href="#" onclick="return doclink('link-15', 'RSA_PUB', 'link-15');">RSA_PUB</a></tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name"><a title="keyczar.keyinfo.KeyType" class="py-name" href="#" onclick="return doclink('link-16', 'KeyType', 'link-6');">KeyType</a></tt><tt class="py-op">(</tt><tt class="py-string">"RSA_PUB"</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-number">2048</tt><tt class="py-op">,</tt> <tt class="py-number">1024</tt><tt class="py-op">,</tt> <tt class="py-number">768</tt><tt class="py-op">,</tt> <tt class="py-number">512</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">256</tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt id="link-17" class="py-name" targets="Variable keyczar.keyinfo.types=keyczar.keyinfo-module.html#types"><a title="keyczar.keyinfo.types" class="py-name" href="#" onclick="return doclink('link-17', 'types', 'link-17');">types</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">"AES"</tt><tt class="py-op">:</tt> <tt id="link-18" class="py-name"><a title="keyczar.keyinfo.AES" class="py-name" href="#" onclick="return doclink('link-18', 'AES', 'link-5');">AES</a></tt><tt class="py-op">,</tt> <tt class="py-string">"HMAC_SHA1"</tt><tt class="py-op">:</tt> <tt id="link-19" class="py-name"><a title="keyczar.keyinfo.HMAC_SHA1" class="py-name" href="#" onclick="return doclink('link-19', 'HMAC_SHA1', 'link-7');">HMAC_SHA1</a></tt><tt class="py-op">,</tt> <tt class="py-string">"DSA_PRIV"</tt><tt class="py-op">:</tt> <tt id="link-20" class="py-name"><a title="keyczar.keyinfo.DSA_PRIV" class="py-name" href="#" onclick="return doclink('link-20', 'DSA_PRIV', 'link-9');">DSA_PRIV</a></tt><tt class="py-op">,</tt>  </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">         <tt class="py-string">"DSA_PUB"</tt><tt class="py-op">:</tt> <tt id="link-21" class="py-name"><a title="keyczar.keyinfo.DSA_PUB" class="py-name" href="#" onclick="return doclink('link-21', 'DSA_PUB', 'link-11');">DSA_PUB</a></tt><tt class="py-op">,</tt> <tt class="py-string">"RSA_PRIV"</tt><tt class="py-op">:</tt> <tt id="link-22" class="py-name"><a title="keyczar.keyinfo.RSA_PRIV" class="py-name" href="#" onclick="return doclink('link-22', 'RSA_PRIV', 'link-13');">RSA_PRIV</a></tt><tt class="py-op">,</tt> <tt class="py-string">"RSA_PUB"</tt><tt class="py-op">:</tt> <tt id="link-23" class="py-name"><a title="keyczar.keyinfo.RSA_PUB" class="py-name" href="#" onclick="return doclink('link-23', 'RSA_PUB', 'link-15');">RSA_PUB</a></tt><tt class="py-op">}</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"> </tt>
<a name="GetType"></a><div id="GetType-def"><a name="L65"></a><tt class="py-lineno"> 65</tt> <a class="py-toggle" href="#" id="GetType-toggle" onclick="return toggle('GetType');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo-module.html#GetType">GetType</a><tt class="py-op">(</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GetType-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="GetType-expanded"><a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">  <tt class="py-keyword">if</tt> <tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt id="link-24" class="py-name"><a title="keyczar.keyinfo.types" class="py-name" href="#" onclick="return doclink('link-24', 'types', 'link-17');">types</a></tt><tt class="py-op">:</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-25" class="py-name"><a title="keyczar.keyinfo.types" class="py-name" href="#" onclick="return doclink('link-25', 'types', 'link-17');">types</a></tt><tt class="py-op">[</tt><tt class="py-name">name</tt><tt class="py-op">]</tt> </tt>
</div><a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">     </tt>
<a name="KeyStatus"></a><div id="KeyStatus-def"><a name="L69"></a><tt class="py-lineno"> 69</tt> <a class="py-toggle" href="#" id="KeyStatus-toggle" onclick="return toggle('KeyStatus');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyinfo.KeyStatus-class.html">KeyStatus</a><tt class="py-op">(</tt><tt class="py-base-class">_NameId</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="KeyStatus-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="KeyStatus-expanded"><a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">  Encodes the different possible statuses of a key:</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">    - Primary: can be used to encrypt and sign new data</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring">    - Active: can be used to decrypt or verify data signed previously</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">    - Inactive: can do the same functions as an active key, but about</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring">      to be revoked</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
</div><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt id="link-26" class="py-name" targets="Variable keyczar.keyinfo.PRIMARY=keyczar.keyinfo-module.html#PRIMARY"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-26', 'PRIMARY', 'link-26');">PRIMARY</a></tt> <tt class="py-op">=</tt> <tt id="link-27" class="py-name" targets="Class keyczar.keyinfo.KeyStatus=keyczar.keyinfo.KeyStatus-class.html"><a title="keyczar.keyinfo.KeyStatus" class="py-name" href="#" onclick="return doclink('link-27', 'KeyStatus', 'link-27');">KeyStatus</a></tt><tt class="py-op">(</tt><tt class="py-string">"PRIMARY"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt id="link-28" class="py-name" targets="Variable keyczar.keyinfo.ACTIVE=keyczar.keyinfo-module.html#ACTIVE"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-28', 'ACTIVE', 'link-28');">ACTIVE</a></tt> <tt class="py-op">=</tt> <tt id="link-29" class="py-name"><a title="keyczar.keyinfo.KeyStatus" class="py-name" href="#" onclick="return doclink('link-29', 'KeyStatus', 'link-27');">KeyStatus</a></tt><tt class="py-op">(</tt><tt class="py-string">"ACTIVE"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt id="link-30" class="py-name" targets="Variable keyczar.keyinfo.INACTIVE=keyczar.keyinfo-module.html#INACTIVE"><a title="keyczar.keyinfo.INACTIVE" class="py-name" href="#" onclick="return doclink('link-30', 'INACTIVE', 'link-30');">INACTIVE</a></tt> <tt class="py-op">=</tt> <tt id="link-31" class="py-name"><a title="keyczar.keyinfo.KeyStatus" class="py-name" href="#" onclick="return doclink('link-31', 'KeyStatus', 'link-27');">KeyStatus</a></tt><tt class="py-op">(</tt><tt class="py-string">"INACTIVE"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt id="link-32" class="py-name" targets="Variable keyczar.keyinfo.statuses=keyczar.keyinfo-module.html#statuses"><a title="keyczar.keyinfo.statuses" class="py-name" href="#" onclick="return doclink('link-32', 'statuses', 'link-32');">statuses</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">"PRIMARY"</tt><tt class="py-op">:</tt> <tt id="link-33" class="py-name"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-33', 'PRIMARY', 'link-26');">PRIMARY</a></tt><tt class="py-op">,</tt> <tt class="py-string">"ACTIVE"</tt><tt class="py-op">:</tt> <tt id="link-34" class="py-name"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-34', 'ACTIVE', 'link-28');">ACTIVE</a></tt><tt class="py-op">,</tt> <tt class="py-string">"INACTIVE"</tt><tt class="py-op">:</tt> <tt id="link-35" class="py-name"><a title="keyczar.keyinfo.INACTIVE" class="py-name" href="#" onclick="return doclink('link-35', 'INACTIVE', 'link-30');">INACTIVE</a></tt><tt class="py-op">}</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"> </tt>
<a name="GetStatus"></a><div id="GetStatus-def"><a name="L83"></a><tt class="py-lineno"> 83</tt> <a class="py-toggle" href="#" id="GetStatus-toggle" onclick="return toggle('GetStatus');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo-module.html#GetStatus">GetStatus</a><tt class="py-op">(</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GetStatus-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="GetStatus-expanded"><a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">  <tt class="py-keyword">if</tt> <tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt id="link-36" class="py-name"><a title="keyczar.keyinfo.statuses" class="py-name" href="#" onclick="return doclink('link-36', 'statuses', 'link-32');">statuses</a></tt><tt class="py-op">:</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-37" class="py-name"><a title="keyczar.keyinfo.statuses" class="py-name" href="#" onclick="return doclink('link-37', 'statuses', 'link-32');">statuses</a></tt><tt class="py-op">[</tt><tt class="py-name">value</tt><tt class="py-op">]</tt> </tt>
</div><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"> </tt>
<a name="KeyPurpose"></a><div id="KeyPurpose-def"><a name="L87"></a><tt class="py-lineno"> 87</tt> <a class="py-toggle" href="#" id="KeyPurpose-toggle" onclick="return toggle('KeyPurpose');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyinfo.KeyPurpose-class.html">KeyPurpose</a><tt class="py-op">(</tt><tt class="py-base-class">_NameId</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="KeyPurpose-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="KeyPurpose-expanded"><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-docstring">  Encodes the different possible purposes for which a key can be used:</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-docstring">    - Decrypt and Encrypt</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-docstring">    - Encrypt (only)</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"><tt class="py-docstring">    - Sign and Verify</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring">    - Verify (only)</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
</div><a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt id="link-38" class="py-name" targets="Variable keyczar.keyinfo.DECRYPT_AND_ENCRYPT=keyczar.keyinfo-module.html#DECRYPT_AND_ENCRYPT"><a title="keyczar.keyinfo.DECRYPT_AND_ENCRYPT" class="py-name" href="#" onclick="return doclink('link-38', 'DECRYPT_AND_ENCRYPT', 'link-38');">DECRYPT_AND_ENCRYPT</a></tt> <tt class="py-op">=</tt> <tt id="link-39" class="py-name" targets="Class keyczar.keyinfo.KeyPurpose=keyczar.keyinfo.KeyPurpose-class.html"><a title="keyczar.keyinfo.KeyPurpose" class="py-name" href="#" onclick="return doclink('link-39', 'KeyPurpose', 'link-39');">KeyPurpose</a></tt><tt class="py-op">(</tt><tt class="py-string">"DECRYPT_AND_ENCRYPT"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt id="link-40" class="py-name" targets="Variable keyczar.keyinfo.ENCRYPT=keyczar.keyinfo-module.html#ENCRYPT"><a title="keyczar.keyinfo.ENCRYPT" class="py-name" href="#" onclick="return doclink('link-40', 'ENCRYPT', 'link-40');">ENCRYPT</a></tt> <tt class="py-op">=</tt> <tt id="link-41" class="py-name"><a title="keyczar.keyinfo.KeyPurpose" class="py-name" href="#" onclick="return doclink('link-41', 'KeyPurpose', 'link-39');">KeyPurpose</a></tt><tt class="py-op">(</tt><tt class="py-string">"ENCRYPT"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt id="link-42" class="py-name" targets="Variable keyczar.keyinfo.SIGN_AND_VERIFY=keyczar.keyinfo-module.html#SIGN_AND_VERIFY"><a title="keyczar.keyinfo.SIGN_AND_VERIFY" class="py-name" href="#" onclick="return doclink('link-42', 'SIGN_AND_VERIFY', 'link-42');">SIGN_AND_VERIFY</a></tt> <tt class="py-op">=</tt> <tt id="link-43" class="py-name"><a title="keyczar.keyinfo.KeyPurpose" class="py-name" href="#" onclick="return doclink('link-43', 'KeyPurpose', 'link-39');">KeyPurpose</a></tt><tt class="py-op">(</tt><tt class="py-string">"SIGN_AND_VERIFY"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt id="link-44" class="py-name" targets="Variable keyczar.keyinfo.VERIFY=keyczar.keyinfo-module.html#VERIFY"><a title="keyczar.keyinfo.VERIFY" class="py-name" href="#" onclick="return doclink('link-44', 'VERIFY', 'link-44');">VERIFY</a></tt> <tt class="py-op">=</tt> <tt id="link-45" class="py-name"><a title="keyczar.keyinfo.KeyPurpose" class="py-name" href="#" onclick="return doclink('link-45', 'KeyPurpose', 'link-39');">KeyPurpose</a></tt><tt class="py-op">(</tt><tt class="py-string">"VERIFY"</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt id="link-46" class="py-name" targets="Variable keyczar.keyinfo.purposes=keyczar.keyinfo-module.html#purposes"><a title="keyczar.keyinfo.purposes" class="py-name" href="#" onclick="return doclink('link-46', 'purposes', 'link-46');">purposes</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">"DECRYPT_AND_ENCRYPT"</tt><tt class="py-op">:</tt> <tt id="link-47" class="py-name"><a title="keyczar.keyinfo.DECRYPT_AND_ENCRYPT" class="py-name" href="#" onclick="return doclink('link-47', 'DECRYPT_AND_ENCRYPT', 'link-38');">DECRYPT_AND_ENCRYPT</a></tt><tt class="py-op">,</tt> <tt class="py-string">"ENCRYPT"</tt><tt class="py-op">:</tt> <tt id="link-48" class="py-name"><a title="keyczar.keyinfo.ENCRYPT" class="py-name" href="#" onclick="return doclink('link-48', 'ENCRYPT', 'link-40');">ENCRYPT</a></tt><tt class="py-op">,</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">            <tt class="py-string">"SIGN_AND_VERIFY"</tt><tt class="py-op">:</tt> <tt id="link-49" class="py-name"><a title="keyczar.keyinfo.SIGN_AND_VERIFY" class="py-name" href="#" onclick="return doclink('link-49', 'SIGN_AND_VERIFY', 'link-42');">SIGN_AND_VERIFY</a></tt><tt class="py-op">,</tt> <tt class="py-string">"VERIFY"</tt><tt class="py-op">:</tt> <tt id="link-50" class="py-name"><a title="keyczar.keyinfo.VERIFY" class="py-name" href="#" onclick="return doclink('link-50', 'VERIFY', 'link-44');">VERIFY</a></tt><tt class="py-op">}</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"> </tt>
<a name="GetPurpose"></a><div id="GetPurpose-def"><a name="L103"></a><tt class="py-lineno">103</tt> <a class="py-toggle" href="#" id="GetPurpose-toggle" onclick="return toggle('GetPurpose');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo-module.html#GetPurpose">GetPurpose</a><tt class="py-op">(</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GetPurpose-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="GetPurpose-expanded"><a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">  <tt class="py-keyword">if</tt> <tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt id="link-51" class="py-name"><a title="keyczar.keyinfo.purposes" class="py-name" href="#" onclick="return doclink('link-51', 'purposes', 'link-46');">purposes</a></tt><tt class="py-op">:</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-52" class="py-name"><a title="keyczar.keyinfo.purposes" class="py-name" href="#" onclick="return doclink('link-52', 'purposes', 'link-46');">purposes</a></tt><tt class="py-op">[</tt><tt class="py-name">name</tt><tt class="py-op">]</tt> </tt>
</div><a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">   </tt>
<a name="CipherMode"></a><div id="CipherMode-def"><a name="L107"></a><tt class="py-lineno">107</tt> <a class="py-toggle" href="#" id="CipherMode-toggle" onclick="return toggle('CipherMode');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyinfo.CipherMode-class.html">CipherMode</a><tt class="py-op">(</tt><tt class="py-base-class">_NameId</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CipherMode-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="CipherMode-expanded"><a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">  <tt class="py-docstring">"""</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-docstring">  Encodes the different possible modes for a cipher:</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">    - Cipher Block Chaining (CBC)</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">    - Counter (CTR)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring">    - Electronic Code Book (ECB)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">    - Cipher Block Chaining without IV (DET-CBC)</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">   </tt>
<a name="CipherMode.__init__"></a><div id="CipherMode.__init__-def"><a name="L116"></a><tt class="py-lineno">116</tt> <a class="py-toggle" href="#" id="CipherMode.__init__-toggle" onclick="return toggle('CipherMode.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo.CipherMode-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">id</tt><tt class="py-op">,</tt> <tt class="py-param">use_iv</tt><tt class="py-op">,</tt> <tt class="py-param">OutputSizeFn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CipherMode.__init__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="CipherMode.__init__-expanded"><a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">    <tt id="link-53" class="py-name"><a title="keyczar.keyinfo._NameId" class="py-name" href="#" onclick="return doclink('link-53', '_NameId', 'link-1');">_NameId</a></tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="keyczar.errors.BadVersionError.__init__
keyczar.errors.InvalidSignatureError.__init__
keyczar.errors.KeyNotFoundError.__init__
keyczar.errors.NoPrimaryKeyError.__init__
keyczar.errors.ShortCiphertextError.__init__
keyczar.errors.ShortSignatureError.__init__
keyczar.keyczar.Keyczar.__init__
keyczar.keyczart._Name.__init__
keyczar.keydata.KeyMetadata.__init__
keyczar.keydata.KeyVersion.__init__
keyczar.keyinfo.CipherMode.__init__
keyczar.keyinfo.KeyType.__init__
keyczar.keyinfo._NameId.__init__
keyczar.keys.AesKey.__init__
keyczar.keys.AsymmetricKey.__init__
keyczar.keys.DsaPrivateKey.__init__
keyczar.keys.DsaPublicKey.__init__
keyczar.keys.HmacKey.__init__
keyczar.keys.Key.__init__
keyczar.keys.PrivateKey.__init__
keyczar.keys.PublicKey.__init__
keyczar.keys.RsaPrivateKey.__init__
keyczar.keys.RsaPublicKey.__init__
keyczar.keys.SymmetricKey.__init__
keyczar.readers.EncryptedReader.__init__
keyczar.readers.FileReader.__init__" class="py-name" href="#" onclick="return doclink('link-54', '__init__', 'link-2');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">id</tt><tt class="py-op">)</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">use_iv</tt> <tt class="py-op">=</tt> <tt class="py-name">use_iv</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">GetOutputSize</tt> <tt class="py-op">=</tt> <tt class="py-name">OutputSizeFn</tt> </tt>
</div></div><a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">     </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt id="link-55" class="py-name" targets="Variable keyczar.keyinfo.CBC=keyczar.keyinfo-module.html#CBC"><a title="keyczar.keyinfo.CBC" class="py-name" href="#" onclick="return doclink('link-55', 'CBC', 'link-55');">CBC</a></tt> <tt class="py-op">=</tt> <tt id="link-56" class="py-name" targets="Class keyczar.keyinfo.CipherMode=keyczar.keyinfo.CipherMode-class.html"><a title="keyczar.keyinfo.CipherMode" class="py-name" href="#" onclick="return doclink('link-56', 'CipherMode', 'link-56');">CipherMode</a></tt><tt class="py-op">(</tt><tt class="py-string">"CBC"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt> <tt class="py-name">i</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">/</tt><tt class="py-name">b</tt> <tt class="py-op">+</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"><tt id="link-57" class="py-name" targets="Variable keyczar.keyinfo.CTR=keyczar.keyinfo-module.html#CTR"><a title="keyczar.keyinfo.CTR" class="py-name" href="#" onclick="return doclink('link-57', 'CTR', 'link-57');">CTR</a></tt> <tt class="py-op">=</tt> <tt id="link-58" class="py-name"><a title="keyczar.keyinfo.CipherMode" class="py-name" href="#" onclick="return doclink('link-58', 'CipherMode', 'link-56');">CipherMode</a></tt><tt class="py-op">(</tt><tt class="py-string">"CTR"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt> <tt class="py-name">i</tt><tt class="py-op">:</tt> <tt class="py-name">i</tt> <tt class="py-op">+</tt> <tt class="py-name">b</tt> <tt class="py-op">/</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"><tt id="link-59" class="py-name" targets="Variable keyczar.keyinfo.ECB=keyczar.keyinfo-module.html#ECB"><a title="keyczar.keyinfo.ECB" class="py-name" href="#" onclick="return doclink('link-59', 'ECB', 'link-59');">ECB</a></tt> <tt class="py-op">=</tt> <tt id="link-60" class="py-name"><a title="keyczar.keyinfo.CipherMode" class="py-name" href="#" onclick="return doclink('link-60', 'CipherMode', 'link-56');">CipherMode</a></tt><tt class="py-op">(</tt><tt class="py-string">"ECB"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt> <tt class="py-name">i</tt><tt class="py-op">:</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"><tt id="link-61" class="py-name" targets="Variable keyczar.keyinfo.DET_CBC=keyczar.keyinfo-module.html#DET_CBC"><a title="keyczar.keyinfo.DET_CBC" class="py-name" href="#" onclick="return doclink('link-61', 'DET_CBC', 'link-61');">DET_CBC</a></tt> <tt class="py-op">=</tt> <tt id="link-62" class="py-name"><a title="keyczar.keyinfo.CipherMode" class="py-name" href="#" onclick="return doclink('link-62', 'CipherMode', 'link-56');">CipherMode</a></tt><tt class="py-op">(</tt><tt class="py-string">"DET_CBC"</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">b</tt><tt class="py-op">,</tt> <tt class="py-name">i</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-name">i</tt> <tt class="py-op">/</tt> <tt class="py-name">b</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt id="link-63" class="py-name" targets="Variable keyczar.keyinfo.modes=keyczar.keyinfo-module.html#modes"><a title="keyczar.keyinfo.modes" class="py-name" href="#" onclick="return doclink('link-63', 'modes', 'link-63');">modes</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">"CBC"</tt><tt class="py-op">:</tt> <tt id="link-64" class="py-name"><a title="keyczar.keyinfo.CBC" class="py-name" href="#" onclick="return doclink('link-64', 'CBC', 'link-55');">CBC</a></tt><tt class="py-op">,</tt> <tt class="py-string">"CTR"</tt><tt class="py-op">:</tt> <tt id="link-65" class="py-name"><a title="keyczar.keyinfo.CTR" class="py-name" href="#" onclick="return doclink('link-65', 'CTR', 'link-57');">CTR</a></tt><tt class="py-op">,</tt> <tt class="py-string">"ECB"</tt><tt class="py-op">:</tt> <tt id="link-66" class="py-name"><a title="keyczar.keyinfo.ECB" class="py-name" href="#" onclick="return doclink('link-66', 'ECB', 'link-59');">ECB</a></tt><tt class="py-op">,</tt> <tt class="py-string">"DET_CBC"</tt><tt class="py-op">:</tt> <tt id="link-67" class="py-name"><a title="keyczar.keyinfo.DET_CBC" class="py-name" href="#" onclick="return doclink('link-67', 'DET_CBC', 'link-61');">DET_CBC</a></tt><tt class="py-op">}</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"> </tt>
<a name="GetMode"></a><div id="GetMode-def"><a name="L127"></a><tt class="py-lineno">127</tt> <a class="py-toggle" href="#" id="GetMode-toggle" onclick="return toggle('GetMode');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyinfo-module.html#GetMode">GetMode</a><tt class="py-op">(</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GetMode-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="GetMode-expanded"><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">  <tt class="py-keyword">if</tt> <tt class="py-name">name</tt> <tt class="py-keyword">in</tt> <tt id="link-68" class="py-name"><a title="keyczar.keyinfo.modes" class="py-name" href="#" onclick="return doclink('link-68', 'modes', 'link-63');">modes</a></tt><tt class="py-op">:</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-69" class="py-name"><a title="keyczar.keyinfo.modes" class="py-name" href="#" onclick="return doclink('link-69', 'modes', 'link-63');">modes</a></tt><tt class="py-op">[</tt><tt class="py-name">name</tt><tt class="py-op">]</tt> </tt>
</div><a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="keyczar-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >Keyczar</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Aug 10 17:05:05 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
